import { createApp } from 'vue'
import App from './App.vue'

//引入router路由
import router from '@/router/index'

//引入element plus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

//Element Plus 提供了全局配置国际化的配置，下面引入中文
import zhCn from 'element-plus/es/locale/lang/zh-cn'

//引入element plus图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//引入Pinia构造函数
import { createPinia } from 'pinia'
//pinia-plugin-persistedstate 插件（pinia持久化插件）
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";

//引入echarts

//引入全局样式
import '@/css/global.css'
// //确定消息弹框封装
// import myconfirm from './utils/myconfirm'

// //对象快速复制工具引入
// import objCoppy from './utils/objCoppy'

//实例pinia
const pinia = createPinia();
// 使用持久化插件
pinia.use(piniaPluginPersistedstate); // 注册插件

//实例vue
const app = createApp(App);

app.use(ElementPlus, {
    locale: zhCn,
  }).use(router).use(pinia).mount('#app');

//element plus全局注册图标组件
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

// //全局挂载消息弹框
// app.config.globalProperties.$myconfirm=myconfirm
// //对象快速复制工具全局挂载
// app.config.globalProperties.$objCoppy=objCoppy